import request from '@/utils/request'

export function login(username, password) {
  return request({
    url: 'auth/login',
    method: 'POST',
    data: {
      username,
      password
    }
  })
}

export function getInfo() {
  return request({
    url: 'auth/info',
    method: 'get'
  })
}
// 通过username获取用户信息
export function getUser(username) {
  return request({
    url: 'auth/findbyUserName?username=' + username,
    method: 'get'
  })
}
// 通过username获取用户信息
export function register(user) {
  return request({
    url: 'auth/register',
    method: 'POST',
    data: user
  })
}
